package edu.byu.intex2.data.bo;

import edu.byu.intex2.data.DataException;
import edu.byu.intex2.data.dao.WarrantyDAO;

/**
 * @author Jason Whiting
 */
public class Warranty extends BusinessObject
{

    private int miles;
    private int months;
    private String type;

    /**
     * Creates a new instance of BusinessObject
     * @param id
     */
    public Warranty(String id)
    {
        super(id);
    }//constructor

    //Quick Access Method
    public void save() throws DataException
    {
        try
        {
            WarrantyDAO.getInstance().save(this);
        } catch (DataException e)
        {
            e.printStackTrace();
        }
    }

    /** @return the miles     */
    public int getMiles()
    {
        return miles;
    }

    /** @param miles the miles to set     */
    public void setMiles(int miles)
    {
        this.miles = miles;
        setDirty();
    }

    /** @return the months     */
    public int getMonths()
    {
        return months;
    }

    /** @param months the months to set    */
    public void setMonths(int months)
    {
        this.months = months;
        setDirty();
    }

    /** @return the type     */
    public String getWarrantyType()
    {
        return type;
    }

    /** @param type the type to set     */
    public void setWarrantyType(String type)
    {
        this.type = type;
        setDirty();
    }
}
